#include "Duck.h"

#include <iostream>

Duck::Duck(){
}

Duck::~Duck(){
}

void Duck::performFly(){
	flyBehavior->fly();
}

void Duck::performQuack(){
	this->quackBehavior->quack();
}

void Duck::swim(){
	std::cout << "Duck swim()" << std::endl;
}

void Duck::setFlyBehavior(FlyBehavior* fb){
    if (this->flyBehavior != NULL) {
        delete this->flyBehavior;
    }
    this->flyBehavior = fb;
}

void Duck::setQuackBehavior(QuackBehavior* qb){
    if (this->quackBehavior != NULL) {
        delete this->quackBehavior;
    }
    this->quackBehavior = qb;
}

